home *** CD-ROM | disk | FTP | other *** search
/ PC User 2002 April / Disc 2 / PCUSER0402D2.iso / software / utils / files / wincron.exe / data1.cab / Sample_Scripts / ftp_rget.tg < prev    next >
Encoding:
Text File  |  2001-10-20  |  1.4 KB  |  44 lines

  1. ## ftp_rget.tg
  2. # Multi-file, recursive Get with wildcards
  3. # script assumes:
  4. # 1. There is a temp/foo directory on the remote server filled with all the files/directories you wish to Get.
  5. # 2. There is a c:\temp\foo local directory.
  6. # 3. the environment variables: USER.SERVER, USER.USERID, and USER.PASSWORD are set elsewhere,
  7. #    perhaps in the global (computer) environment or the local environment of WinCron via 
  8. #    Config.tg or AutoRun.tg. You could also set them here in this this script or hard-code the 
  9. #    values passed to -ftp connect.
  10.  
  11. # get/put a file
  12. {
  13.     -name ftp_rget
  14.     -start 
  15.     -stop
  16.     -action -print get/put file from remote ftp server
  17.     -action -print connecting to remote ftp server
  18.     -action -onerror connect_fail
  19.     -action -ftp connect handle %USER.SERVER% 21 %USER.USERID% %USER.PASSWORD%
  20.     -action -print getting file from remote ftp server
  21.     -action -onerror operation_fail
  22.     -action -ftp rget handle temp/foo/* c:\temp\foo 0
  23.     -action -ftp close handle 
  24.     -action -print done!
  25. }
  26.  
  27. # connection failed
  28. {
  29.     -name connect_fail
  30.     -action -print FTP open connection failed with error:
  31.     -action -print %TG.LAST_ERROR%
  32.     -action -return abort
  33. }
  34.  
  35. # operation failed
  36. {
  37.     -name operation_fail
  38.     -action -print FTP get/put failed with error:
  39.     -action -print %TG.LAST_ERROR%
  40.     -action -print Closing connection.
  41.     -action -ftp close handle
  42.     -action -return abort
  43. }
  44.